<?php
		
	/* module.config.php Module Admin */
	Hook::create("KERNEL.MENU.TOP.ADD.CPanel",false); //Administration/Modération
	/*Hook::create("KERNEL.MODULE.REQUIRED.FOR:ADMIN",false);
	Hook::add("KERNEL.MODULE.REQUIRED.FOR:ADMIN",function(){
		if(Hook::call("KERNEL.MODULE.EXISTS.MEMBRE")==true)
			return true;
		else
			return -1;
	});*/
	
	Hook::add("KERNEL.MODULE.FUNCTION",function($module) {
		if(file_exists($module.'/function.inc.php'))
			include_once "function.inc.php";
	});
	
	//CPanel
		
		
	Hook::add("KERNEL.MENU.TOP.ADD.CPanel",function($cssDir,$level){
		
		if($level == ADMIN)
			return '<a href="' . getLienModule("admin","index.admin") . '" alt="Zone d\'administration" title="Zone d\'administration"><img src="' .  $cssDir . '/images/header/pAdmin.png" border="0"></a>';
		else if($level == MODO)
			return '<a href="' . getLienModule("admin","index.modo") . '" alt="Modération" title="Modération"><img src="' . $cssDir . '/images/header/pModo.png" border="0"></a>';
		else if($level == NEWSER)
			return '<a href="' . getLienModule("admin","index.newser") . '" alt="Gestion des news" title="Gestion des news"><img src="' . $cssDir . '/images/header/pNews.png" border="0"></a>';
	});
		
	Hook::add("KERNEL.MENU.TOP.ADD",function($cssDir){
		if(Hook::call("KERNEL.MODULE.EXISTS.MEMBRE")==true){
				$level = isset($_SESSION["id"]) ? id2level($_SESSION['id']) : -1;
			if($level>MEMBRE)
				return Hook::call("KERNEL.MENU.TOP.ADD.CPanel",$cssDir,$level);
		}
	},60);
	
	

?>